/*
 * Alloy Analyzer
 * Copyright (c) 2002 Massachusetts Institute of Technology
 *
 * The Alloy Analyzer is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * The Alloy Analyzer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with the Alloy Analyzer; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package alloy.ast;

/**
 * Interface implemented by AST nodes implementing Alloy expressions, such as "A.B".
 * Note that all expressions have a {@linkplain alloy.type type}.  Alloy AST nodes are
 * of three kinds: {@link Formula}, {@link Expr} or {@link IntExpr}; the root of the AST
 * is always a {@link Formula}.
 *
 * @see alloy.transl.ExprTransl
 */
public interface Expr extends HasType {

    /** @return <code>true</code> if this was enclosed in parens in the source of the model; <code>false</code> otherwise */
    boolean hasParens();
	
    /** set paren status */
    void setParens(boolean parens_);

    BinaryExpr join(Expr other_);

    BinaryExpr union(Expr other_);

    BinaryExpr diff(Expr other_);

    BinaryExpr intersect(Expr other_);

    BinaryExpr product(Expr other_);

    BinaryExpr override(Expr other_);
    
    ElemFormula in(Expr other_);

    ElemFormula eq(Expr other_);
    
}
